package com.pro.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;
import java.util.logging.Logger;

/**
 * @ClassName: Dept
 * @Author: 笑笑
 * @DATE: 2021/11/9
 * @TIME: 下午10:23
 */
public class Dept {

  private long id;
  private String deptName;
  private String deptDescirbe;
  private long parentId;
  private String createId;

  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GTM+8")
  private String createDate;
  private String updateId;

  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
  private Date updateDate;
  private String status;

  public Dept() {
  }

  public Dept(long id, String deptName, String deptDescirbe, long parentId, String createId, String createDate, String updateId, Date updateDate, String status) {
    this.id = id;
    this.deptName = deptName;
    this.deptDescirbe = deptDescirbe;
    this.parentId = parentId;
    this.createId = createId;
    this.createDate = createDate;
    this.updateId = updateId;
    this.updateDate = updateDate;
    this.status = status;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }


  public String getDeptName() {
    return deptName;
  }

  public void setDeptName(String deptName) {
    this.deptName = deptName;
  }


  public String getDeptDescirbe() {
    return deptDescirbe;
  }

  public void setDeptDescirbe(String deptDescirbe) {
    this.deptDescirbe = deptDescirbe;
  }


  public long getParentId() {
    return parentId;
  }

  public void setParentId(long parentId) {
    this.parentId = parentId;
  }


  public String getCreateId() {
    return createId;
  }

  public void setCreateId(String createId) {
    this.createId = createId;
  }

  public String getCreateDate() {
    return createDate;
  }

  public void setCreateDate(String createDate) {
    this.createDate = createDate;
  }


  public String getUpdateId() {
    return updateId;
  }

  public void setUpdateId(String updateId) {
    this.updateId = updateId;
  }


  public Date getUpdateDate() {
    return updateDate;
  }

  public void setUpdateDate(Date updateDate) {
    this.updateDate = updateDate;
  }


  public String getStatus() {
    return status;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Dept dept = (Dept) o;
    return id == dept.id &&
            parentId == dept.parentId &&
            Objects.equals(deptName, dept.deptName) &&
            Objects.equals(deptDescirbe, dept.deptDescirbe) &&
            Objects.equals(createId, dept.createId) &&
            Objects.equals(createDate, dept.createDate) &&
            Objects.equals(updateId, dept.updateId) &&
            Objects.equals(updateDate, dept.updateDate) &&
            Objects.equals(status, dept.status);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, deptName, deptDescirbe, parentId, createId, createDate, updateId, updateDate, status);
  }

  @Override
  public String toString() {
    return "Dept{" +
            "id=" + id +
            ", deptName='" + deptName + '\'' +
            ", deptDescirbe='" + deptDescirbe + '\'' +
            ", parentId=" + parentId +
            ", createId='" + createId + '\'' +
            ", createDate=" + createDate +
            ", updateId='" + updateId + '\'' +
            ", updateDate=" + updateDate +
            ", status='" + status + '\'' +
            '}';
  }
}
